package User;

import User.factory.AdminUserFactory;
import User.factory.IUserFactory;
import User.factory.NomalUserFactory;

import java.lang.reflect.Proxy;

public class UserMangerment {
    public static void main(String[] args) {
        IUserFactory adminUserFactory = new AdminUserFactory();
        User admin = adminUserFactory.creatUser("刘备", 1);

        IUserFactory nomalUserFactory = new NomalUserFactory();
        User normal = nomalUserFactory.creatUser("关⽻", 2);


        ProxyUser proxyadmin = new ProxyUser(admin);
        proxyadmin.borrowBook("jjj");

        ProxyUser proxynormal = new ProxyUser(normal);
    }
    public static void main1(String[] args) {
        // 直接创建管理员⽤⼾
        AdminUser adminUser = new AdminUser("刘备", 1);
// 直接创建普通⽤⼾
        NomalUser normalUser1 = new NomalUser("关⽻", 2);
        NomalUser normalUser2 = new NomalUser("张⻜", 3);
    }
}
